home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr42 / smixc111.zip / SMIX.H < prev    next >
C/C++ Source or Header  |  1995-02-15  |  4KB  |  94 lines

  1. /* ██ SMIX.H █████████████████████████████████████████████████████████████ */
  2.  
  3. #define TRUE  1
  4. #define FALSE 0
  5.  
  6. #define ON  1
  7. #define OFF 0
  8.  
  9. typedef struct
  10.   {
  11.     int xmshandle;
  12.     long startofs;
  13.     long soundsize;
  14.   } SOUND;
  15.  
  16. int  init_sb(int baseio, int irq, int dma, int dma16);
  17.   /* Initializes control parameters, resets DSP and installs int. handler   */
  18.   /*  Parameters:                                                           */
  19.   /*   baseio    Sound card base IO address                                 */
  20.   /*   irq       Sound card IRQ setting                                     */
  21.   /*   dma       Sound card 8-bit DMA channel                               */
  22.   /*   dma16     Sound card 16-bit DMA channel                              */
  23.   /*  Returns:                                                              */
  24.   /*   TRUE      Sound card successfully initialized                        */
  25.   /*   FALSE     Sound card could not be initialized                        */
  26.  
  27. void shutdown_sb(void);
  28.   /* Removes interrupt handler and resets DSP                               */
  29.  
  30.  
  31. void init_mixing(void);
  32.   /* Allocates internal buffers and starts digitized sound output           */
  33.  
  34. void shutdown_mixing(void);
  35.   /* Deallocates internal buffers and stops digitized sound output          */
  36.  
  37.  
  38. int  init_xms(void);
  39.   /* Initializes extended memory driver                                     */
  40.   /*  Returns:                                                              */
  41.   /*   TRUE      Extended memory driver successfully initialized            */
  42.   /*   FALSE     Extended memory driver could not be initialized            */
  43.  
  44. int  getfreexms(void);
  45.   /* Returns amount of free extended memory (In kilobytes)                  */
  46.  
  47.  
  48. void init_sharing(void);
  49.   /* Allocates an EMB that all sound data will be stored in.  Using this    */
  50.   /* will preserve extended memory handles, which are scarce resources.     */
  51.   /* Call this on initialization and all sounds will automatically be       */
  52.   /* stored in one EMB.  You can call load_sound as usual to allocate a     */
  53.   /* sound, but free_sound will only deallocate the sound data structure.   */
  54.   /* You must call shutdown_sharing before program termination in order     */
  55.   /* to free all allocated extended memory.                                 */
  56.  
  57. void shutdown_sharing(void);
  58.   /* Shuts down EMB sharing and frees shared EMB block                      */
  59.  
  60.  
  61. void load_sound(SOUND **sound, char *filename);
  62.   /* Allocates an extended memory block and loads a sound from a file       */
  63.   /*  Parameters:                                                           */
  64.   /*   sound     Pointer to pointer to unallocated sound data structure     */
  65.   /*   filename  Pointer to character string containing filename            */
  66.  
  67. void free_sound(SOUND **sound);
  68.   /* Frees sound data structure and extended memory block                   */
  69.   /*  Parameters:                                                           */
  70.   /*   sound     Pointer to pointer to allocated sound data structure       */
  71.  
  72.  
  73. void start_sound(SOUND *sound, int index, int loop);
  74.   /* Starts playing a sound                                                 */
  75.   /*  Parameters:                                                           */
  76.   /*   sound     Pointer to sound data structure                            */
  77.   /*   index     A number to keep track of the sound with (Used to stop it) */
  78.   /*   loop      Indicates whether sound should be continuously looped      */
  79.  
  80. void stop_sound(int index);
  81.   /* Stops playing a sound                                                  */
  82.   /*  Parameters:                                                           */
  83.   /*   index     Index of sound to stop (All with given index are stopped)  */
  84.  
  85. extern volatile long  intcount;       /* Current count of sound interrupts  */
  86. extern volatile float dspversion;     /* Version of the sound card DSP chip */
  87. extern volatile int   voicecount;     /* Number of voices currently in use  */
  88.  
  89. extern int autoinit;
  90. extern int sixteenbit;
  91.  
  92. /* ████████████████████████████████████████████████████████████████████████ */
  93.  
  94.